package com.wanxi.web.controller;


import com.wanxi.enterprise.api.query.EnterpriseQuery;
import com.wanxi.enterprise.api.query.LocateApplyQuery;
import com.wanxi.enterprise.api.result.CommonResult;
import com.wanxi.enterprise.api.vo.LocateApplyAuditInVo;
import com.wanxi.enterprise.api.vo.NoLocateApplyInVO;
import com.wanxi.web.service.enterprise.EnterpriseWebService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
*@ClassName: AdminEnterpriseController
*@Description: 管理员管理商家
*@Author lxl
*@Date 2022/1/17
*@Version 1.0
*
*/

@RestController
@Api(tags = "管理员商家接口")
public class AdminEnterpriseController {

    @Resource
    private EnterpriseWebService enterpriseService;

    /**
     * @author jinfang
     * @Description //管理员查看商家基本信息
     **/
    @GetMapping("admin/findEnterpriseAll")
    public CommonResult findAll(EnterpriseQuery enterpriseQuery){
        return enterpriseService.findAll(enterpriseQuery);
    }


    /**
     * @author jinfang
     * @Description //管理员查看商家入驻信息，方便审核
     **/
    @GetMapping("admin/findApplyAll")
    public CommonResult findApplyAll(LocateApplyQuery enterpriseQuery){
        return enterpriseService.findApplyAll(enterpriseQuery);
    }

    /**
     * @Author jinfang
     * @Description // 管理员点击审核通过，并录入到入驻资料表
     **/
    @PutMapping("admin/addApplyData")
   public CommonResult updateApply(LocateApplyAuditInVo locateApplyAuditInVo){
       return enterpriseService.updateApply(locateApplyAuditInVo);
    }

    /**
     * @Author jinfang
     * @Description // 管理员点击审核驳回，并且通过邮箱方式返回驳回理由给商家
     **/
    @GetMapping("admin/noApply")
   public CommonResult noApply(NoLocateApplyInVO noLocateApplyInVO){
        return enterpriseService.noApply(noLocateApplyInVO);
    }


}
